Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for multipart/form-data and x-www-form-urlencoded #9

Merged
merged 2 commits into from
Apr 3, 2023

Conversation

simonkimi
Copy link
Contributor

multipart/form-data before:

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ⤴ REQUEST ⤴
│ 
│ POST http://localhost:8080/example
│ content-type: multipart/form-data; boundary=--dio-boundary-0780880521
│ content-length: 1100034
│ 
│ 
│ Instance of 'FormData'

after:

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ⤴ REQUEST ⤴
│ 
│ POST http://localhost:8080/example
│ content-type: multipart/form-data; boundary=--dio-boundary-0780880521
│ content-length: 1100034
│ 
│ 
│ {
│   "field1": "foo",
│   "field2": "bar",
│   "file": "[MultipartFile] foo.zip length: 1099699"
│ }

application/x-www-form-urlencoded before:

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ⤴ REQUEST ⤴
│ 
│ POST http://localhost:8080/example
│ content-type: application/x-www-form-urlencoded
│ content-length: 21
│ 
│ 
│ {field1: foo, field2: bar}

after:

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ⤴ REQUEST ⤴
│ 
│ POST http://localhost:8080/example
│ content-type: application/x-www-form-urlencoded
│ content-length: 21
│ 
│ 
│ {
│   "field1": "foo",
│   "field2": "bar",
│ }

@assemmarwan assemmarwan self-assigned this Mar 19, 2023
@assemmarwan assemmarwan added the enhancement New feature or request label Mar 19, 2023
@assemmarwan
Copy link
Owner

@simonkimi Great addition!

Please add examples in README for both the content-types

@simonkimi
Copy link
Contributor Author

I changed the display style and now the file upload display is as follows

┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ ⤴ REQUEST ⤴
│ 
│ POST https://postman-echo.com/post
│ content-type: multipart/form-data; boundary=--dio-boundary-0846883596
│ content-length: 234
│ 
│ 
│ {
│   "foo": "foo",
│   "bar": "[application/octet-stream; length=6]"
│ }

@simonkimi
Copy link
Contributor Author

I have completed the changes to readme, please review.

@assemmarwan assemmarwan merged commit b35e960 into assemmarwan:master Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants